package com.jxtc.enterprise.employee.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.List;


@Schema(description = "微信小程序端创建订单所需要传递的数据")
@Getter
@Setter
@ToString
public class OrderCreateDTO {
    @Schema(description = "登录账号 1~11位，手机号 或 字母+数字组合", example = "11012341234, c1025824")
    @Size(message = "登录账号 1~11位，手机号 或 字母+数字组合", min = 1, max = 11)
    @NotBlank(message = "手机号不能为空")
    private String phone;

    /**
     * 获取用户微信号对应的openId的 授权码
     */
    private String authorizeCodeForOpenId;

    @Schema(description = "菜单id", example = "152d9648a8af4ee887354296fc0c8cb7")
    @NotBlank(message = "菜单 ID 不能为空")
    private String menuId;

    @Schema(description = "购物车 ID 列表", example = "[\"1803796487419985921\", \"1803796506101415938\"]")
    @NotEmpty(message = "购物车 ID 列表不能为空")
    private List<String> shoppingCartIds;

    @Schema(description = "公司 ID", example = "565a416545cc196d005439407b953fdd")
    @NotBlank(message = "公司 ID 不能为空")
    private String companyId;

    @Schema(description = "订单总金额", example = "20.00")
    @DecimalMin(value = "0.0", inclusive = true, message = "金额不能小于 0")
    @NotNull(message = "订单总金额不能为空")
    private BigDecimal totalPrice;

    @Schema(description = "订单显示价格", example = "20.00")
    @DecimalMin(value = "0.0", inclusive = true, message = "金额不能小于 0")
    @NotNull(message = "订单显示价格不能为空")
    private BigDecimal totalShowPrice;

    @Schema(description = "订单备注信息")
    private String note;

    @Schema(description = "余额支付金额", example = "19.00")
    @DecimalMin(value = "0.0", inclusive = true, message = "金额不能小于 0")
    @NotNull(message = "余额支付金额不能为空")
    private BigDecimal walletPay;

    @Schema(description = "微信支付金额", example = "0.01")
    @DecimalMin(value = "0.0", inclusive = true, message = "金额不能小于 0")
    @NotNull(message = "微信实际支付金额不能为空")
    private BigDecimal realPayPrice;

    @Schema(description = "取餐人姓名", example = "张三")
    private String nameTakingMeal;

    @Schema(description = "取餐地址", example = "xxx街道xx号")
    private String address;
}
